/**
 * @description 首页相关类型定义
 */

// 用户统计数据
export interface UserStatistics {
  totalUsers: number;
  onlineUsers: number;
  todayNewUsers: number;
  userStatusDistribution: {
    active: number;
    inactive: number;
    pending: number;
  };
}

// 任务统计数据
export interface TaskStatistics {
  pendingTasks: number;
  completedTasks: number;
  weeklyProgress: number;
  priorityDistribution: {
    high: number;
    medium: number;
    low: number;
  };
}

// 工具使用统计
export interface ToolStatistics {
  totalUsage: number;
  mostPopularTool: string;
  todayUsage: number;
  userActivity: number;
  toolUsageDetails: {
    [key: string]: number;
  };
}

// 系统状态
export interface SystemStatistics {
  uptime: Date;
  apiResponseTime: number;
  errorCount: number;
  resourceUsage: {
    cpu: number;
    memory: number;
    disk: number;
  };
}

// 图表数据
export interface ChartData {
  userGrowthTrend: {
    dates: string[];
    values: number[];
  };
  moduleUsageDistribution: {
    name: string;
    value: number;
  }[];
  taskCompletionChart: {
    categories: string[];
    series: {
      name: string;
      data: number[];
    }[];
  };
  systemActivityHeatmap: {
    hours: string[];
    days: string[];
    data: number[][];
  };
}

// 活动记录
export interface ActivityRecord {
  id: string;
  userName: string;
  action: string;
  module: string;
  description: string;
  timestamp: string;
  type: "login" | "operation" | "system" | "task";
}

// 通知消息
export interface NotificationItem {
  id: string;
  title: string;
  content: string;
  type: "announcement" | "warning" | "reminder" | "update";
  priority: "high" | "medium" | "low";
  isRead: boolean;
  createTime: string;
}

// 快速访问菜单项
export interface QuickAccessItem {
  id: string;
  title: string;
  icon: string;
  route: string;
  color: string;
  isAiGenerated?: boolean; // 标识是否为AI生成的功能
}

// 首页数据汇总
export interface HomePageData {
  userStats: UserStatistics;
  taskStats: TaskStatistics;
  toolStats: ToolStatistics;
  systemStats: SystemStatistics;
  chartData: ChartData;
  recentActivities: ActivityRecord[];
  notifications: NotificationItem[];
  quickAccessItems: QuickAccessItem[];
}

// 统计卡片数据
export interface StatCard {
  title: string;
  value: string | number;
  change: number;
  changeType: "increase" | "decrease" | "neutral";
  icon: string;
  color: string;
  description?: string;
}
